package com.zsy.servlet;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Login extends HttpServlet {

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String user = req.getParameter("user");
		String pass = req.getParameter("pass");
		if(user.equalsIgnoreCase("admin")&&pass.equalsIgnoreCase("admin123")){
			req.getSession().setAttribute("user", user);
		
			resp.sendRedirect(req.getContextPath()+"/web/showkey?type=1");
		}else{
			resp.sendRedirect("index.html");
		}
	}

	
}
